#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;

void Test1()
{
	char a = 101;
	int sum = 200;
	a += 27; sum += a;
	printf("%c %d \n", a, a);
	printf("%d %c\n", sum, sum);
}

void Test2()
{
	int value = 1024;
	char condition = *((char*)(&value));
	printf("%d\n", condition); // 0
	if (condition) value += 1; condition = *((char*)(&value));
	if (condition) value += 1; condition = *((char*)(&value));
	printf("%d %d\n", value, condition);
}

void Test3()
{
	char para[100];
	void* p = malloc(100);
	printf("%d, %d, %d\n", sizeof(para), sizeof(p),sizeof(int));
}

void func(char* p) { p = p + 1; } //传值传递，对外部无影响
void Test4()
{
	char s[] = { '1', '2', '3', '4' };
	func(s);
	printf("%c ", *s);
	
}


bool isZishou(int x)
{
	int t = x * x;
	while (x)
	{
		int a1 = x % 10;
		int a2 = t % 10;
		if (a1 != a2)return false;
		x /= 10;
		t /= 10;
	}
	return true;
}

bool Is_Prime(int x)
{
	for (int i = 2; i <= x / i; i++)
	{
		if (x % i == 0) return false;
	}
	return true;
}


int main()
{
	//Test1();
	Test2();
	
	//Test3();
	//Test4();

	return 0;
}